PROJECT=kconf2h
CC=gcc
CFLAGS=
SOURCES=$(PROJECT)_parser.c
OBJECTS=$(SOURCES:.c=.o)

all: clean ragel $(OBJECTS) $(PROJECT)

$(PROJECT):
	$(CC) $(CFLAGS) $(OBJECTS) $(PROJECT).c -o $(PROJECT)

ragel:
	ragel $(PROJECT)_parser.ragel

%.o: %.c
	$(CC) $(CFLAGS) -c $<

clean:
	rm -f $(PROJECT)
	rm -f *.o
